<template>
  <div>
    <el-page-header @back="$emit('close')" :content="'项目学员：' + project.name" />
    <div class="app-container">
      <el-table :data="tableData" style="width: 100%" v-loading="tloading">
        <el-table-column prop="id" label="id"> </el-table-column>
        <el-table-column prop="name" label="姓名"> </el-table-column>
        <el-table-column prop="mobile" label="联系号码"> </el-table-column>
        <el-table-column prop="cardNumber" label="身份证"> </el-table-column>
        <el-table-column prop="age" label="年龄">
          <template slot-scope="scope">
            {{ scope.row.userType || "-" }}
          </template>
        </el-table-column>
        <el-table-column prop="clothingSize" label="衣服尺码">
          <template slot-scope="scope">
            {{ scope.row.clothingSize || "-" }}
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="创建时间"> </el-table-column>
        <el-table-column prop="grade" label="年级">
          <template slot-scope="scope">
            {{ scope.row.grade || "-" }}
          </template>
        </el-table-column>
        <el-table-column prop="sex" label="性别">
          <template slot-scope="scope">
            {{ scope.row.userType == 1 ? "男" : "女" }}
          </template>
        </el-table-column>
        <el-table-column prop="storeId" label="机构id"> </el-table-column>
        <el-table-column prop="userId" label="用户id">
          <template slot-scope="scope">
            {{ scope.row.userId || "-" }}
          </template>
        </el-table-column>
        <el-table-column prop="userType" label="用户类型">
          <template slot-scope="scope">
            {{ scope.row.userType == 0 ? "学员" : "机构" }}
          </template>
        </el-table-column>
        <el-table-column prop="option" label="操作">
          <template slot-scope="{ row }">
            <el-button type="text" @click="tofegncai(row)">个人风采</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-dialog append-to-body title="个人风采" :visible.sync="isFengcaiShow" width="70%">
        <fengcaipage v-if="isFengcaiShow" :projectid="soloject.projectId" :id="soloject.id" />
      </el-dialog>
    </div>
  </div>
</template>
<script>
import { uploadFile } from "@/api/data";
import { getProjectMember } from "@/api/mini/yanxue";
export default {
  components: {
    fengcaipage: () => import("./fengcaipage"),
  },
  props: {
    project: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      tableData: [],
      soloject: {},
      isFengcaiShow: false,
      tloading: false,
    };
  },
  created() {
    this.getData();
  },
  methods: {
    tofegncai(row) {
      this.isFengcaiShow = true;
      this.soloject = row;
    },
    getData() {
      this.tloading = true;
      getProjectMember(this.project.id).then((res) => {
        this.tableData = res.data;
        this.tloading = false;
      });
    },
  },
};
</script>
<style lang="less" scoped></style>
